package com.platform.dao;

import com.platform.pojo.User;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int checkUsername(String username);

    User selectLogin(@Param("username") String username, @Param("password")String password);

    int checkEmail(String email);

    int checkPhone(String phone);

    int checkEmailByUserId(@Param(value="email")String email,@Param(value="userId")Integer userId);

    int updatePasswordByUsername(@Param("username")String username,@Param("passwordNew")String passwordNew);

    /**
     *
     * @param phone
     * @param username
     * @return
     */
    Integer selectByPhoneAndUsername(@Param(value = "phone") String phone,@Param(value = "username") String username);
}